<template>
  <div class="cententInfo">
    <div class="content">
      <!-- 左侧 -->
      <div class="leftContent">
        <el-steps
          :active="active"
          space-size="50px"
          direction="vertical"
          finish-status="wait"
          align-center
          :space="80"
          style="margin-top: 20px"
        >
          <el-step title="企业基本信息" icon="iconfont icon-qiyejibenxinxi">
          </el-step>
          <el-step
            title="位置分布人员信息"
            icon="iconfont icon-a-weizhifenbujiben"
          >
          </el-step>
          <el-step title="人员统计基本信息" icon="iconfont icon-a-zu19815">
          </el-step>
          <el-step title="企业机构信息" icon="iconfont icon-a-qiyejigoujiben">
          </el-step>
          <el-step
            title="安全管理信息"
            icon="iconfont icon-a-anquanguanlijiben"
          >
          </el-step>
          <el-step
            title="企业风险及重大危险源信息"
            icon="iconfont icon-a-qiyefengxianjiben"
          >
          </el-step>
          <el-step title="附加信息" icon="iconfont icon-a-fujiajiben">
          </el-step>
        </el-steps>
      </div>

      <!-- 右侧 -->
      <div class="rightContent">
        <!-- 企业基础信息 -->
        <template v-if="active == 0">
          <enterprise-base ref="enterpriseBaseRef"></enterprise-base>
        </template>
        <!-- 位置分布人员信息 -->
        <template v-else-if="active == 1">
          <location-personnel></location-personnel>
        </template>
        <!-- 人员统计基本信息 -->
        <template v-else-if="active == 2">
          <statistical-basic></statistical-basic>
        </template>

        <!-- 企业机构信息 -->
        <template v-else-if="active == 3">
          <enterprise-institutions></enterprise-institutions>
        </template>

        <!-- 安全管理信息 -->
        <template v-else-if="active == 4">
          <security-management></security-management>
        </template>

        <!-- 企业风险及重大危险源信息 -->
        <template v-else-if="active == 5">
          <enterprise-risk></enterprise-risk>
        </template>

        <!-- 附加信息 -->
        <template v-else-if="active == 6">
          <additional-info></additional-info>
        </template>

        <!-- 下一步按钮 -->
        <!-- <el-button class="buttonNext" style="margin-top: 12px;" @click="next">下一步</el-button> -->
      </div>
    </div>
  </div>
</template>

<script>
import "../../../src/assets/icon/editorPage/iconfont.css";

import SecurityManagement from "./component/securityManagement.vue";
import enterpriseBase from "./component/enterpriseBasic.vue";
import EnterpriseInstitutions from "./component/enterpriseInstitutions.vue";
import LocationPersonnel from "./component/locationPersonnel.vue";
import StatisticalBasic from "./component/statisticalBasic.vue";
import EnterpriseRisk from "./component/enterpriseRisk.vue";
import AdditionalInfo from "./component/additionalInfo.vue";
import { enterpriseNewListAPI } from "@/api/personnel/organization/index";

export default {
  components: {
    enterpriseBase,
    LocationPersonnel,
    StatisticalBasic,
    EnterpriseInstitutions,
    SecurityManagement,
    EnterpriseRisk,
    AdditionalInfo,
  },
  data() {
    return {
      active: 0,
      form: {},
      isShow:false
    };
  },
  watch: {
    
  },
  created() {
    this.getTableData()
  },
  methods: {
    next() {
      if (this.active++ > 5) {
        this.$message({
          message: "请提交哦",
          type: "warning",
        });
        this.active = 6;
      }
    },
    // 获取列表数据
    async getTableData() {
      const res = await enterpriseNewListAPI();
      // this.form = res.data;
      this.$refs.enterpriseBaseRef.form=res.data
      // console.log("父组件的数据", res.data);
      // this.isShow =true
    },
  },
};
</script>

<style lang="scss" scoped>
.cententInfo {
  overflow: auto;
}
.content {
  display: flex;
  flex-wrap: wrap;
  .leftContent {
    width: 20%;
    height: 2000px;
    background: white;
    box-shadow: 0 0 20px #979696;
  }
  .rightContent {
    position: relative;
    margin-left: 10px;
    width: 79%;
    height: 2000px;
    background: white;
    box-shadow: 0 0 20px #979696;
  }
}

.buttonNext {
  position: absolute;
  bottom: 10px;
  right: 10px;
}

.iconfontColor {
  color: black;
  width: 1em;
  height: 1em;
}

.step01 {
  color: red;
}

/deep/ .el-steps {
  width: 80%;
  .el-step {
    left: 35px;
  }
  .el-step__icon {
    // width:56px;
    // height:56px;
  }
  .el-step__line {
    width: 0px;
  }
  .el-step__title.is-process {
    color: #0c66ff;
    font-size: 18px;
  }
  .el-step__head.is-process {
    color: #0c66ff;
  }
  // .el-step__head.is-finish{
  //   border-color: #285edf;
  // }
  .el-step__title.is-finish {
    color: #285edf;
  }
  .el-step__icon.is-icon {
    background: transparent;
  }
  .el-step__title.is-wait {
    color: #c0c4cc;
    font-size: 18px;
  }
}

.iconfont {
  font-size: 18px;
}
</style>